//app.js
let QQMapWX = require('./utils/qqmap-wx-jssdk');
let qqmapsdk;
App({
  onLaunch: function () {
    // 展示本地存储能力
    qqmapsdk = new QQMapWX({
      key: '2ZDBZ-BO2KO-G5GW5-SONYC-WU2OH-PJB5P'
    });
   console.log(wx.getMenuButtonBoundingClientRect());
  //  this.getUserLocation();
  //  console.log(this.globalData)
  },
  globalData: {
    userInfo: null,
    aboveDistance: wx.getMenuButtonBoundingClientRect().top + wx.getMenuButtonBoundingClientRect().height + 5 + 'px',
    city: ''
  },
  // getUserLocation() {
  //   const _this = this;
  //   wx.getLocation({
  //     success(res) {
  //       // console.log(res);
  //       qqmapsdk.reverseGeocoder({
  //         location: `${res.latitude},${res.longitude}`,
  //         success(val) {
  //           // console.log(val);
  //           // console.log(val.result.address_component.city.replace(/市|县/, ""));
  //           let add = val.result.address_component.city.replace(/市|县/, "");
  //           _this.globalData.city = add;
  //           console.log('地址啊是是是',_this.globalData)
  //         }
  //       })
  //     }
  //   })
  //  console.log('地址我是',this.globalData.city)

  // }
})